import QtQuick 2.0
import QtCharts 2.2


ChartView {
    id:piechartview
    width: 800
    height: 400

    theme: ChartView.ChartThemeBrownSand
    animationDuration: 2000
    animationOptions: ChartView.SeriesAnimations
    animationEasingCurve: ChartView.SeriesAnimations
    antialiasing: true
    legend.visible: true
    legend.alignment:Qt.AlignBottom

    PieSeries{
        id:piesSeries
        PieSlice{label: "报警数量:"+value  ; value: 10  ; color: "red" ; labelVisible: true ; labelPosition: PieSlice.LabelOutside}
        PieSlice{label: "离线数量:"+value  ; value: 10 ; color: "grey" ; labelVisible: true ; labelPosition: PieSlice.LabelOutside}
        PieSlice{label: "在线数量:"+value  ; value: 80 ; color: "green" ; labelVisible: true ; labelPosition: PieSlice.LabelOutside}
    }

    function setDevCntInfo(emg , offline , online){
        piesSeries.at(0).value = emg
        piesSeries.at(1).value = offline
        piesSeries.at(2).value = online
    }
}
